package test.db.table.mysql.type;

import test.db.table.Table;

/**
 * @author newbie
 * @since 0.1
 */
public enum PwIpCountryTable implements Table, ColumnType {
    START_IP_LONG(Column.startIpLong),
    END_IP_LONG(Column.endIpLong),
    START_IP(Column.startIp),
    END_IP(Column.endIp),
    COUNTRY_TWO(Column.countryTwo),
    COUNTRY_THREE(Column.countryThree),
    COUNTRY_FULL(Column.countryFull);
    
    private final Column column;
    private static final String TYPE_START_IP_LONG = "VARCHAR(10)";
    private static final String TYPE_END_IP_LONG = "VARCHAR(10)";
    private static final String TYPE_START_IP = "VARCHAR(32)";
    private static final String TYPE_END_IP = "VARCHAR(32)";
    private static final String TYPE_COUNTRY_TWO = "VARCHAR(2)";
    private static final String TYPE_COUNTRY_THREE = "VARCHAR(3)";
    private static final String TYPE_COUNTRY_FULL = "VARCHAR(40)";
    
    PwIpCountryTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        startIpLong {
            String getType() {
                return TYPE_START_IP_LONG;
            }
        },
        
        endIpLong {
            String getType() {
                return TYPE_END_IP_LONG;
            }
        },
        
        startIp {
            String getType() {
                return TYPE_START_IP;
            }
        },
        
        endIp {
            String getType() {
                return TYPE_END_IP;
            }
        },
        
        countryTwo {
            String getType() {
                return TYPE_COUNTRY_TWO;
            }
        },
        
        countryThree {
            String getType() {
                return TYPE_COUNTRY_THREE;
            }
        },
        
        countryFull {
            String getType() {
                return TYPE_COUNTRY_FULL;
            }
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
    }
}